home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getnetent.man < prev    next >
Encoding:
Text File  |  1990-11-25  |  3.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETNETENT             C Library Procedures              GETNETENT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getnetent, getnetbyaddr, getnetbyname, setnetent, endnetent
  10.      - get network entry
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<nneettddbb..hh>>
  14.  
  15.      ssttrruucctt nneetteenntt **ggeettnneetteenntt(())
  16.  
  17.      ssttrruucctt nneetteenntt **ggeettnneettbbyynnaammee((nnaammee))
  18.      cchhaarr **nnaammee;;
  19.  
  20.      ssttrruucctt nneetteenntt **ggeettnneettbbyyaaddddrr((nneett,, ttyyppee))
  21.      lloonngg nneett;;
  22.      iinntt ttyyppee;;
  23.  
  24.      sseettnneetteenntt((ssttaayyooppeenn))
  25.      iinntt ssttaayyooppeenn;;
  26.  
  27.      eennddnneetteenntt(())
  28.  
  29. DDEESSCCRRIIPPTTIIOONN
  30.      _G_e_t_n_e_t_e_n_t, _g_e_t_n_e_t_b_y_n_a_m_e, and _g_e_t_n_e_t_b_y_a_d_d_r each return a
  31.      pointer to an object with the following structure containing
  32.      the broken-out fields of a line in the network data base,
  33.      /_e_t_c/_n_e_t_w_o_r_k_s.
  34.  
  35.           struct    netent {
  36.                char      *n_name;  /* official name of net */
  37.                char      **n_aliases;   /* alias list */
  38.                int       n_addrtype;    /* net number type */
  39.                unsigned long  n_net;         /* net number */
  40.           };
  41.  
  42.      The members of this structure are:
  43.  
  44.      n_name      The official name of the network.
  45.  
  46.      n_aliases   A zero terminated list of  alternate  names  for
  47.                  the network.
  48.  
  49.      n_addrtype  The  type  of  the  network   number   returned;
  50.                  currently only AF_INET.
  51.  
  52.      n_net       The  network  number.    Network   numbers   are
  53.                  returned in machine byte order.
  54.  
  55.      _G_e_t_n_e_t_e_n_t reads the next line of the file, opening the  file
  56.      if necessary.
  57.  
  58.      _S_e_t_n_e_t_e_n_t opens and rewinds the file.  If the _s_t_a_y_o_p_e_n  flag
  59.      is non-zero, the net data base will not be closed after each
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 19, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETNETENT             C Library Procedures              GETNETENT
  71.  
  72.  
  73.  
  74.      call to _g_e_t_n_e_t_b_y_n_a_m_e or _g_e_t_n_e_t_b_y_a_d_d_r.
  75.  
  76.      _E_n_d_n_e_t_e_n_t closes the file.
  77.  
  78.      _G_e_t_n_e_t_b_y_n_a_m_e and _g_e_t_n_e_t_b_y_a_d_d_r sequentially search  from  the
  79.      beginning  of  the  file  until  a  matching net name or net
  80.      address and type is found,  or  until  EOF  is  encountered.
  81.      Network numbers are supplied in host order.
  82.  
  83. FFIILLEESS
  84.      /etc/networks
  85.  
  86. SSEEEE AALLSSOO
  87.      networks(5)
  88.  
  89. DDIIAAGGNNOOSSTTIICCSS
  90.      Null pointer (0) returned on EOF or error.
  91.  
  92. BBUUGGSS
  93.      All information is contained in a static area so it must  be
  94.      copied  if it is to be saved.  Only Internet network numbers
  95.      are currently understood.  Expecting network numbers to  fit
  96.      in no more than 32 bits is probably naive.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 19, 1986                          2
  130.  
  131.  
  132.  
  133.